import Mapbox from './mapbox'
import AMap from './amap'
enum mapType {
  MAPBOX,
  AMAP,
}

export interface IMap {
  // Promise中返回真实地图的实例，用来判断地图是否加载完成等
  getRelMapPromise(): Promise<unknown>
  // 页面退出时销毁地图实例
  destroy(): void
  // renderPolygon(geojson: any): void
  // renderPoint(geojson: any): void
}

export default class WRMap {
  static type = mapType

  static getMap(mapType: mapType) {
    switch (mapType) {
      case WRMap.type.AMAP:
        return AMap
      case WRMap.type.MAPBOX:
        return Mapbox
    }
  }
}
